//
//  oldSupporCardView.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/3/14.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldSupporCardView.h"
#import "UIImageView+oldImageView.h"

@interface oldSupporCardView()
@property (weak, nonatomic) IBOutlet UILabel *label_name;
@property (weak, nonatomic) IBOutlet UILabel *label_type;
@property (weak, nonatomic) IBOutlet UIImageView *img_avatar;
@property (weak, nonatomic) IBOutlet UILabel *label_status;

@end

@implementation oldSupporCardView

- (void)awakeFromNib
{
    [super awakeFromNib];
    _img_avatar.layer.cornerRadius = 30.f;
    self.layer.cornerRadius = 6.f;
    self.layer.borderColor = Color_With_Rgb(230, 230, 230, 0.7).CGColor;
    self.layer.borderWidth = 1.f;
    
    UITapGestureRecognizer *ges = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(view_tapped:)];
    
    [self addGestureRecognizer:ges];
}

- (void)view_tapped:(id)sender
{
    [self.delegate oldSupporCardViewTapped];
}

- (void)setOrderInfo:(oldOrderInfo *)orderInfo
{
    _orderInfo = orderInfo;
    [_img_avatar showHeadImg:orderInfo.serverInfo.avatar];
    _label_name.text = orderInfo.serverInfo.uname;
    _label_type.text = orderInfo.serveCategory.cname;
    _label_status.text = [NSString stringWithFormat:@"状态:%@", [orderInfo oldStatusString]];
    if ([orderInfo.status integerValue] == Order_End) {
        _label_status.textColor = Color_With_Rgb(242, 102, 18, 1);
    }
    else
    {
        _label_status.textColor = Color_With_Rgb(179, 179, 179, 1);
    }
}

@end
